﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Core.LockStep
{
    public interface IStreamData : IPoolObj
    {
        object ReadFrom(IFrameDataStream stream);
        void WriteTo(IFrameDataStream stream);
        string GetDescription();
    }

    public abstract class StreamData<T> : IStreamData
    {
        public abstract T ReadFrom(IFrameDataStream stream);
        public abstract void WriteTo(IFrameDataStream stream);
        public abstract void Clear();
        public virtual string GetDescription() { return ""; }

        object IStreamData.ReadFrom(IFrameDataStream stream)
        {
            return ReadFrom(stream);
        }
    }
}